Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix apollo-client import error: 'import' and 'export' may only appear at the top level #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jessedvrs
Copy link

When importing from 'apollo-client/transport/networkInterface', the transpiler gives the error:

Error: Parsing file node_modules/apollo-client/transport/networkInterface.js: 'import' and 'export' may only appear at the top level (10:0)

Which is fixed when importing directly from 'apollo-client'. Unfortunately, printRequest isn't exposed that way, so I copied the function from here. Therefore, I had to add graphql-tag as a direct dependency.

With this low risk fix, everything works fine again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant